<style>
    .uk-table  uk-table-responsive  uk-table-striped uk-table-hover uk-table-middle dux-table .checkbox {
        display: inline-block;
        width: 150px;
        white-space: nowrap;
    }
</style>
<div class="dux-page-header uk-clearfix">
    <div class="page-title">
        <a class="uk-button uk-button-primary" href="{url('index')}"> 角色列表</a>
    </div>
    <div class="page-action">
        <a class="uk-button uk-button-danger" href="javascript:location.reload();"><i class="fa fa-refresh"></i></a>
    </div>
</div>

<div class="uk-margin-top">
    <div class="uk-card uk-card-default uk-card-small dux-panel">
        <div class="uk-card-header">{$assignName}角色</div>
        <div class="uk-card-body">
            <form class="dux-form uk-form   uk-form-horizontal " data-dux="form-bind" method="post">
                <fieldset>
                    <div class="uk-form-group">
                        <label class=" uk-form-label">角色名</label>
                        <div class="uk-form-controls">
                            <input type="text" name="name" value="{$info.name}" placeholder="请输入角色名" minlength="1" required>
                        </div>
                    </div>
                    <div class="uk-form-group">
                        <label class=" uk-form-label">角色描述</label>
                        <div class="uk-form-controls">
                            <input type="text" name="description" value="{$info.description}" placeholder="角色描述信息" minlength="3" required>
                        </div>
                    </div>
                    <div class="uk-form-group">
                        <label class=" uk-form-label">状态</label>
                        <div class="uk-form-controls">
                            <?php if(!isset($info['status'])) $info[ 'status']=1 ; ?>
                            <div>
                                <select name="status" data-dux="form-select" required>
                                    <option value="1" <!--if{$info['status']}--> selected <!--{/id}--> >正常</option>
                                    <option value="0" <!--if{!$info['status']}--> selected <!--{/id}--> >禁用</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="uk-form-group">
                        <div class="uk-form-controls">
                            <input type="hidden" name="role_id" value="{$info.role_id}">
                            <button class="uk-button uk-button-primary" type="submit" disabled>保存</button>
                        </div>
                    </div>

                </fieldset>
            </form>
        </div>
    </div>
</div>
<script>
    $(function () {
        $('table').find('thead input[type=checkbox]').change(function () {
            if ($(this).prop('checked')) {
                $(this).parents('table').find("[type='checkbox']").prop("checked", true);
            } else {
                $(this).parents('table').find("[type='checkbox']").prop("checked", false);
            }
        });
        $('table').find('.row').change(function () {
            if ($(this).prop('checked')) {
                $(this).parents('tr').find("[type='checkbox']").prop("checked", true);
            } else {
                $(this).parents('tr').find("[type='checkbox']").prop("checked", false);
            }
        });
    });
</script>